//
//  HHUserInfo.m
//  FCHealthy
//
//  Created by mouxiaochun on 16/3/3.
//  Copyright © 2016年 mmc. All rights reserved.
//

#import "HHUserInfo.h"


@implementation HHUserInfo
- (void)dealloc {

    self.address      = nil;
    self.birthday     = nil;
    self.gender       = nil;
    self.idcardnumber = nil;
    self.username     = nil;
}

- (NSString *)birthday {
    NSTimeInterval timeInterval = [_birthday doubleValue]/1000;
    NSDate *date = [NSDate dateWithTimeIntervalSince1970:timeInterval];
    NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];//设置成中国阳历
    NSDateComponents *comps = [[NSDateComponents alloc] init];
    NSInteger unitFlags = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSWeekdayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit;//这句我也不明白具体时用来做什么。。。
    comps = [calendar components:unitFlags fromDate:date];
    long day=[comps day];//获取日期对应的长整形字符串
    long year=[comps year];//获取年对应的长整形字符串
    long month=[comps month];//获取月对应的长整形字符串
    NSString *destDateString = [NSString stringWithFormat:@"%zi年%zi月%zi日",year,month,day];
    return destDateString;
}

 
@end
